package com.zhangfei.plus.aopexception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class AopExceptionController {
    @Autowired
    private AopExceptionService aopExceptionService;

    @RequestMapping("/A")
    private void A() {
        System.out.println("AopExceptionController do  A()");
        try {
            aopExceptionService.B();
        }catch (Exception e){
            System.out.println(e);
        }
    }

    @RequestMapping("/B")
    public void B() {
        System.out.println("AopExceptionController do  A()");
        try {
            aopExceptionService.B();
        }catch (Exception e){
            System.out.println(e);
        }
    }
}
